package com.five.matebook.utils;

import android.util.Log;

public class LogUtils {
    public static final int LOG_DEBUG = 0b001;
    public static final int LOG_INFO = 0b010;
    public static final int LOG_ERROR = 0b100;
    public static final int LOG_LEVEL_ALL = LOG_DEBUG | LOG_INFO | LOG_ERROR;

    private static int sLogLevel = LOG_INFO | LOG_ERROR;

    private static final String TAG_PREFFIX = "====";
    public static void d(String tag, String s) {
        if ( (sLogLevel & LOG_DEBUG) != 0) {
            Log.i(TAG_PREFFIX + tag, s);
        }
    }
    public static void i(String tag, String s) {
        if ( (sLogLevel & LOG_INFO) != 0) {
            Log.i(TAG_PREFFIX + tag, s);
        }
    }

    public static void e(String tag, String s) {
        if ( (sLogLevel & LOG_ERROR) != 0) {
            Log.e(TAG_PREFFIX + tag, s);
        }
    }

    public static void setLogLevel(int logLevel) {
        sLogLevel = logLevel;
    }
}